package com.cx.meta.exception;

/**
 * @author flysand
 * @package com.cx.meta.exception
 * @date 2021-11-09 23:49
 * @des CxErrorCode:
 */
public class CxErrorCode {

    public final static CxErrorCode SERVER_EXCEPTION = new CxErrorCode("1000", "服务器异常");

    public final static CxErrorCode REDIS_SERVER_EXCEPTION = new CxErrorCode("1001", "redis服务器异常");

    public final static CxErrorCode MYSQL_SERVER_EXCEPTION = new CxErrorCode("1002", "mysql服务器异常");

    public final static CxErrorCode ORACLE_SERVER_EXCEPTION = new CxErrorCode("1003", "oracle服务器异常");

    public final static CxErrorCode CASSANDRA_SERVER_EXCEPTION = new CxErrorCode("1004", "cassandra服务器异常");

    public final static CxErrorCode ELASTICSEARCH_SERVER_EXCEPTION = new CxErrorCode("1005", "es服务器异常");

    public final static CxErrorCode KAFKA_SERVER_EXCEPTION = new CxErrorCode("1006", "kafka服务器异常");

    public final static CxErrorCode ZOOKEEPER_SERVER_EXCEPTION = new CxErrorCode("1007", "zk服务器异常");

    public final static CxErrorCode MESSAGE_SERVER_EXCEPTION = new CxErrorCode("1008", "短信服务器异常");


    public final static CxErrorCode REGISTER_INFO_EMPTY = new CxErrorCode("1001", "注册信息不能为空");

    public final static CxErrorCode USER_NAME_EMPTY = new CxErrorCode("1002", "用户名不能为空");

    public final static CxErrorCode USER_NAME_EXISTS = new CxErrorCode("1003", "用户名已存在");

    public final static CxErrorCode PASSWORD_EMPTY = new CxErrorCode("1004", "密码不能为空");

    public final static CxErrorCode RE_PASSWORD_EMPTY = new CxErrorCode("1005", "重复密码不能为空");

    public final static CxErrorCode PASSWORD_FORMAT_ERROR = new CxErrorCode("1006", "密码格式不正确");

    public final static CxErrorCode PASSWORD_ERROR = new CxErrorCode("1006", "密码不正确");

    public final static CxErrorCode PASSWORD_NOT_EQUAL = new CxErrorCode("1007", "两次密码不一致");


    /**
     * 选择手机号注册时，手机号不能为空
     */
    public final static CxErrorCode MOBILE_EMPTY = new CxErrorCode("1011", "手机号不能为空");
    /**
     * 选择邮箱注册时，邮箱不能为空
     */
    public final static CxErrorCode EMAIL_EMPTY = new CxErrorCode("1012", "邮箱不能为空");

    public final static CxErrorCode CODE_EMPTY = new CxErrorCode("1013", "验证码不能为空");

    public final static CxErrorCode MOBILE_OR_CODE_EMPTY = new CxErrorCode("1014", "手机号和验证码不能为空");

    public final static CxErrorCode LOGIN_NAME_OR_PASSWORD_EMPTY = new CxErrorCode("1015", "登录名和密码不能为空");

    public final static CxErrorCode LOGIN_NAME_ERROR = new CxErrorCode("1016", "登录名不正确");

    public final static CxErrorCode CODE_ERROR = new CxErrorCode("1017", "验证码错误");


    public final static CxErrorCode ACCESS_LIMIT = new CxErrorCode("2001", "权限不足");

    /**
     * token为空
     */
    public final static CxErrorCode UN_LOGIN = new CxErrorCode("2002", "用户未登录");

    public final static CxErrorCode TOKEN_EXPIRED = new CxErrorCode("2003", "认证信息已过期");

    public final static CxErrorCode OTHER_LOGIN = new CxErrorCode("2004", "账号在其他地方登录");


    private String errCode;
    private String errMsg;


    public CxErrorCode(String errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }


    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
